package com.codefish.config;

import com.aliyun.oss.OSSClient;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

/**
 * @Classname AliyunClient
 * @Description TODO
 * @Date 2021/5/3 19:41
 * @Created 学兔斯基眯眼看世界
 */
@Component
@Configuration
@ConfigurationProperties(prefix = "aliyun")
public class AliyunClient {


    private String accessKeyId;

    private String accessKeySecret;

    private String smsCode;

    private String endpoint;

    private String signName;

    private String bucketName;

    @Bean
    public OSSClient getOssClient(){
        return new OSSClient(endpoint,accessKeyId,accessKeySecret);
    }

    public String getBucketName() {
        return bucketName;
    }

    public void setBucketName(String bucketName) {
        this.bucketName = bucketName;
    }

    public String getSignName() {
        return signName;
    }

    public void setSignName(String signName) {
        this.signName = signName;
    }

    public String getEndpoint() {
        return endpoint;
    }

    public void setEndpoint(String endpoint) {
        this.endpoint = endpoint;
    }

    public String getAccessKeyId() {
        return accessKeyId;
    }

    public void setAccessKeyId(String accessKeyId) {
        this.accessKeyId = accessKeyId;
    }

    public String getAccessKeySecret() {
        return accessKeySecret;
    }

    public void setAccessKeySecret(String accessKeySecret) {
        this.accessKeySecret = accessKeySecret;
    }

    public String getSmsCode() {
        return smsCode;
    }

    public void setSmsCode(String smsCode) {
        this.smsCode = smsCode;
    }
}
